Change in openvpn[master]: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
A message that is not in the archive (sent off-list or not yet received): gerrit.1765907598000.Ia6c3f0395bd6cd67064fe77420d9df2b66763049@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
to review the following change.
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
Just use the correct type.
---
M src/openvpn/ssl_verify_openssl.c
1 file changed, 4 insertions(+), 13 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/1445/1
src/openvpn/ssl_verify_openssl.c +4 -13
@@ -674,11 +674,6 @@return FAILURE ; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif -result_t x509_verify_cert_ku (X509 *x509,const unsigned *const expected_ku,int expected_len) {
@@ -697,8 +692,8 @@return SUCCESS ; } -unsigned nku =0 ; -for (size_t i =0 ; i <8 ; i++) +unsigned int nku =0 ; +for (int i =0 ; i <8 ; i++) {if (ASN1_BIT_STRING_get_bit (ku, i)) {
@@ -716,7 +711,7 @@msg (D_HANDSHAKE ,"Validating certificate key usage" );result_t fFound =FAILURE ; -for (size_t i =0 ; fFound !=SUCCESS && i < expected_len; i++) +for (int i =0 ; fFound !=SUCCESS && i < expected_len; i++) {if (expected_ku[i] !=0 && (nku & expected_ku[i]) == expected_ku[i]) {
@@ -727,7 +722,7 @@if (fFound !=SUCCESS ) {msg (D_TLS_ERRORS ,"ERROR: Certificate has key usage %04x, expected one of:" , nku); -for (size_t i =0 ; i < expected_len && expected_ku[i]; i++) +for (int i =0 ; i < expected_len && expected_ku[i]; i++) {msg (D_TLS_ERRORS ," * %04x" , expected_ku[i]); }
@@ -738,10 +733,6 @@return fFound; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -result_t x509_verify_cert_eku (X509 *x509,const char *const expected_oid) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
mandree has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
Patch Set 1: Code-Review-2
(5 comments)
Patchset:
PS1:
I think the fixes go in the wrong direction.
File src/openvpn/ssl_verify_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/821e73fa_f775f9c3?usp=email :
PS1, Line 678: x509_verify_cert_ku(X509 *x509, const unsigned *const expected_ku, int expected_len) expected_len might be an unsigned int or size_t to fix warnings below.
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/d6e1387e_3213e9eb?usp=email :
PS1, Line 696: for (int i = 0; i < 8; i++)
I don't seem to have the ASN1_BIT_STRING_get_bit() manpage handy, but if the compiler is unhappy about the nku |= line, make the literals unsigned, as in nku |= 1u << (7u - i) while i is some unsigned type (such as size_t).
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/253f9ee2_e2908373?usp=email :
PS1, Line 714: for (int i = 0; fFound != SUCCESS && i < expected_len; i++)
If this triggers a signed/unsigned mismatch on the < - that's because the iterator was a size_t and the expected_len argument a signed plain "int".
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/360f53ad_26945225?usp=email :
PS1, Line 725: for (int i = 0; i < expected_len && expected_ku[i]; i++)
If this triggers a signed/unsigned mismatch on the < - that's because the iterator was a size_t and the expected_len argument a signed plain "int".
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 16 Dec 2025 19:41:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: flichtenheld, plaisthos.
mandree has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
Patch Set 1:
(1 comment)
File src/openvpn/ssl_verify_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/c27d7464_b4c44732?usp=email :
PS1, Line 696: for (int i = 0; i < 8; i++)
Quoted 1 line
I don't seem to have the
ASN1_BIT_STRING_get_bit()manpage handy, but if the compiler is unhappy about the nku |= line, make the literals unsigned, as in nku |= 1u << (7u - i) while i is some unsigned type (such assize_t).
So the 2nd argument to ASN1_BIT_STRING_get_bit() wants to be a literal "int" so this one change in the "for" would be OK.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 16 Dec 2025 19:46:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: mandree <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
Hello mandree, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
to look at the new patch set (#2).
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
Just use the correct types.
v2:
- Change type of expected_len argument to size_t
---
M src/openvpn/ssl_verify_backend.h
M src/openvpn/ssl_verify_mbedtls.c
M src/openvpn/ssl_verify_openssl.c
3 files changed, 5 insertions(+), 14 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/1445/2
src/openvpn/ssl_verify_backend.h +1 -1
@@ -243,7 +243,7 @@* if key usage is not enabled, or the values do not match. */ result_t x509_verify_cert_ku (openvpn_x509_cert_t *x509,const unsigned *const expected_ku, -int expected_len); +size_t expected_len);/* * Verify X.509 extended key usage extension field.
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -483,7 +483,7 @@ }result_t -x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned int *const expected_ku,size_t expected_len) {msg (D_HANDSHAKE ,"Validating certificate key usage" );
src/openvpn/ssl_verify_openssl.c +3 -12
@@ -674,13 +674,8 @@return FAILURE ; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif -result_t -x509_verify_cert_ku (X509 *x509,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (X509 *x509,const unsigned int *const expected_ku,size_t expected_len) {ASN1_BIT_STRING *ku =X509_get_ext_d2i (x509, NID_key_usage,NULL ,NULL );
@@ -697,8 +692,8 @@return SUCCESS ; } -unsigned nku =0 ; -for (size_t i =0 ; i <8 ; i++) +unsigned int nku =0 ; +for (int i =0 ; i <8 ; i++) {if (ASN1_BIT_STRING_get_bit (ku, i)) {
@@ -738,10 +733,6 @@return fFound; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -result_t x509_verify_cert_eku (X509 *x509,const char *const expected_oid) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Attention is currently required from: mandree, plaisthos.
flichtenheld has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
Patch Set 2:
(3 comments)
File src/openvpn/ssl_verify_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/daf21b8d_ebd343a0?usp=email :
PS1, Line 678: x509_verify_cert_ku(X509 *x509, const unsigned *const expected_ku, int expected_len)
Quoted 1 line
expected_lenmight be an unsigned int orsize_tto fix warnings below.
Done
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/c6d817b4_b71d7230?usp=email :
PS1, Line 714: for (int i = 0; fFound != SUCCESS && i < expected_len; i++)
Quoted 1 line
If this triggers a signed/unsigned mismatch on the < - that's because the iterator was a
size_tand […]
Done
http://gerrit.openvpn.net/c/openvpn/+/1445/comment/f6912297_5457cc36?usp=email :
PS1, Line 725: for (int i = 0; i < expected_len && expected_ku[i]; i++)
Quoted 1 line
If this triggers a signed/unsigned mismatch on the < - that's because the iterator was a
size_tand […]
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: mandree <[email protected]...>
Gerrit-Comment-Date: Wed, 17 Dec 2025 14:26:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: mandree <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
mandree has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
Patch Set 4: Code-Review-2
(2 comments)
Patchset:
PS1:
Quoted 1 line
I think the fixes go in the wrong direction.
Done
Patchset:
PS4:
the revised version seems OK, but I haven't compile-time tested it.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 16 Jan 2026 19:31:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: mandree <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
mandree has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 16 Jan 2026 19:31:43 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 19 Jan 2026 12:20:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH v4 1/1 ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]...>
Just use the correct types.
v2:
- Change type of expected_len argument to size_t
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1445
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1445
This mail reflects revision 4 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/ssl_verify_backend.h +1 -1
@@ -243,7 +243,7 @@* if key usage is not enabled, or the values do not match. */ result_t x509_verify_cert_ku (openvpn_x509_cert_t *x509,const unsigned *const expected_ku, -int expected_len); +size_t expected_len);/* * Verify X.509 extended key usage extension field.
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -483,7 +483,7 @@ }result_t -x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned int *const expected_ku,size_t expected_len) {msg (D_HANDSHAKE ,"Validating certificate key usage" );
src/openvpn/ssl_verify_openssl.c +3 -12
@@ -674,13 +674,8 @@return FAILURE ; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif -result_t -x509_verify_cert_ku (X509 *x509,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (X509 *x509,const unsigned int *const expected_ku,size_t expected_len) {ASN1_BIT_STRING *ku =X509_get_ext_d2i (x509, NID_key_usage,NULL ,NULL );
@@ -697,8 +692,8 @@return SUCCESS ; } -unsigned nku =0 ; -for (size_t i =0 ; i <8 ; i++) +unsigned int nku =0 ; +for (int i =0 ; i <8 ; i++) {if (ASN1_BIT_STRING_get_bit (ku, i)) {
@@ -738,10 +733,6 @@return fFound; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -result_t x509_verify_cert_eku (X509 *x509,const char *const expected_oid) {
[Openvpn-devel] [PATCH applied] Re: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
+1 on the v4 integer change from Mathias, and BB is happy as well -> +2 from me, in it goes. v4 is also quite simple and straightforward :-)
Your patch has been applied to the master branch.
commit de3ef0dc65036b6efc650c768e0296419a801b20
Author: Frank Lichtenheld Date: Mon Jan 19 13:20:51 2026 +0100
ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
Signed-off-by: Frank Lichtenheld <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1445
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35322.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#5) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
The following approvals got outdated and were removed:
Code-Review+1 by mandree, Code-Review+2 by cron2
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
Just use the correct types.
v2:
- Change type of expected_len argument to size_t
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1445
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35322.html
---
M src/openvpn/ssl_verify_backend.h
M src/openvpn/ssl_verify_mbedtls.c
M src/openvpn/ssl_verify_openssl.c
3 files changed, 5 insertions(+), 14 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/45/1445/5
src/openvpn/ssl_verify_backend.h +1 -1
@@ -240,7 +240,7 @@* if key usage is not enabled, or the values do not match. */ result_t x509_verify_cert_ku (openvpn_x509_cert_t *x509,const unsigned *const expected_ku, -int expected_len); +size_t expected_len);/* * Verify X.509 extended key usage extension field.
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -486,7 +486,7 @@ }result_t -x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned int *const expected_ku,size_t expected_len) {msg (D_HANDSHAKE ,"Validating certificate key usage" );
src/openvpn/ssl_verify_openssl.c +3 -12
@@ -670,13 +670,8 @@return FAILURE ; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif -result_t -x509_verify_cert_ku (X509 *x509,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (X509 *x509,const unsigned int *const expected_ku,size_t expected_len) {ASN1_BIT_STRING *ku =X509_get_ext_d2i (x509, NID_key_usage,NULL ,NULL );
@@ -693,8 +688,8 @@return SUCCESS ; } -unsigned nku =0 ; -for (size_t i =0 ; i <8 ; i++) +unsigned int nku =0 ; +for (int i =0 ; i <8 ; i++) {if (ASN1_BIT_STRING_get_bit (ku, i)) {
@@ -734,10 +729,6 @@return fFound; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -result_t x509_verify_cert_eku (X509 *x509,const char *const expected_oid) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email )
Change subject: ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
......................................................................
ssl_verify_openssl: Avoid conversion warning in x509_verify_cert_ku
Just use the correct types.
v2:
- Change type of expected_len argument to size_t
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1445
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35322.html
---
M src/openvpn/ssl_verify_backend.h
M src/openvpn/ssl_verify_mbedtls.c
M src/openvpn/ssl_verify_openssl.c
3 files changed, 5 insertions(+), 14 deletions(-)
src/openvpn/ssl_verify_backend.h +1 -1
@@ -240,7 +240,7 @@* if key usage is not enabled, or the values do not match. */ result_t x509_verify_cert_ku (openvpn_x509_cert_t *x509,const unsigned *const expected_ku, -int expected_len); +size_t expected_len);/* * Verify X.509 extended key usage extension field.
src/openvpn/ssl_verify_mbedtls.c +1 -1
@@ -486,7 +486,7 @@ }result_t -x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (mbedtls_x509_crt *cert,const unsigned int *const expected_ku,size_t expected_len) {msg (D_HANDSHAKE ,"Validating certificate key usage" );
src/openvpn/ssl_verify_openssl.c +3 -12
@@ -670,13 +670,8 @@return FAILURE ; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif -result_t -x509_verify_cert_ku (X509 *x509,const unsigned *const expected_ku,int expected_len) +x509_verify_cert_ku (X509 *x509,const unsigned int *const expected_ku,size_t expected_len) {ASN1_BIT_STRING *ku =X509_get_ext_d2i (x509, NID_key_usage,NULL ,NULL );
@@ -693,8 +688,8 @@return SUCCESS ; } -unsigned nku =0 ; -for (size_t i =0 ; i <8 ; i++) +unsigned int nku =0 ; +for (int i =0 ; i <8 ; i++) {if (ASN1_BIT_STRING_get_bit (ku, i)) {
@@ -734,10 +729,6 @@return fFound; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -result_t x509_verify_cert_eku (X509 *x509,const char *const expected_oid) {
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1445?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia6c3f0395bd6cd67064fe77420d9df2b66763049
Gerrit-Change-Number: 1445
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: mandree <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>